package com.niconicod.ofb.utils.flightmodel;

import com.badlogic.gdx.math.Vector2;

public class DummyFlightModel extends FlightModel {

    private float angle;
    private float speed;
    private float rotationSpeed;

    public DummyFlightModel(Vector2 position, Vector2 startNoseDirection, float speed, float rotationSpeed) {
        super(position, startNoseDirection);
        this.speed = speed;
        this.rotationSpeed = rotationSpeed;
    }

    @Override
    public void act(float delta) {
        angle += rudderLevel * rotationSpeed * delta;

        Vector2 movementAdd = new Vector2(getNoseDirection());
        movementAdd.scl(speed * thrustLevel * delta);
        position.add(movementAdd);
    }

    @Override
    public Vector2 getNoseDirection() {
        return new Vector2(startNoseDirection).rotateDeg(getAngleDeg());
    }

    @Override
    public float getAngleDeg() {
        return angle;
    }
}
